package com.attms.service.impl;

import com.attms.dao.EmployeeDao;
import com.attms.domain.Employee;
import com.attms.service.IAccountService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountServiceImpl extends ServiceImpl<EmployeeDao, Employee> implements IAccountService {
    @Autowired
    private EmployeeDao employeeDao;
    @Override
    public Boolean login(Integer id, String password) {
        QueryWrapper<Employee> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("E_ID", id).eq("E_PASSWORD", password);
        Employee result = employeeDao.selectOne(queryWrapper);
        return result != null;
    }
}
